<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>StaffRecordType</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            <span class="type">Class</span>
            StaffRecordType
            
                <span class="parent">&lt;
                    
                    Object
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../files/app/enums/staff_record_type_rb.html">app/enums/staff_record_type.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-c-collection">collection</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>F</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-c-find">find</a>,
              </li>
            
              
              <li>
                <a href="#method-c-find_by_name">find_by_name</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-c-name">name</a>,
              </li>
            
              
              <li>
                <a href="#method-c-name_in">name_in</a>,
              </li>
            
              
              <li>
                <a href="#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    
      <!-- Section constants -->
      <div class="sectiontitle">Constants</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class="attr-name">ID_TYPES</td>
            <td>=</td>
            <td class="attr-value">{&#39;salaries_log&#39; =&gt; &#39;薪资发放记录&#39;, &#39;adjust_logs&#39; =&gt; &#39;调薪记录&#39;, &#39;attendences_log&#39; =&gt; &#39;考勤记录&#39;,
&#39;rewards_log&#39; =&gt; &#39;奖励记录&#39;, &#39;disciplines_log&#39; =&gt; &#39;惩戒记录&#39;, &#39;overtimes_log&#39; =&gt; &#39;加班记录&#39;}</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
          <tr valign='top'>
            <td class="attr-name">TYPES_ID</td>
            <td>=</td>
            <td class="attr-value">ID_TYPES.invert</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
      </table>
    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>id</td>
            <td class='attr-desc'></td>
          </tr>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>name</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-collection">
            
              <b>collection</b>()
            
            <a href="../classes/StaffRecordType.html#method-c-collection" name="method-c-collection" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-collection_source')" id="l_method-c-collection_source">show</a>
                
              </p>
              <div id="method-c-collection_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/enums/staff_record_type.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">collection</span>
  <span class="ruby-constant">ID_TYPES</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)}
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-find">
            
              <b>find</b>(id)
            
            <a href="../classes/StaffRecordType.html#method-c-find" name="method-c-find" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-find_source')" id="l_method-c-find_source">show</a>
                
              </p>
              <div id="method-c-find_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/enums/staff_record_type.rb, line 13</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">id</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">ID_TYPES</span>[<span class="ruby-identifier">id</span>]
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">id</span>, <span class="ruby-constant">ID_TYPES</span>[<span class="ruby-identifier">id</span>])
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-find_by_name">
            
              <b>find_by_name</b>(name)
            
            <a href="../classes/StaffRecordType.html#method-c-find_by_name" name="method-c-find_by_name" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-find_by_name_source')" id="l_method-c-find_by_name_source">show</a>
                
              </p>
              <div id="method-c-find_by_name_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/enums/staff_record_type.rb, line 21</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">find_by_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">TYPES_ID</span>[<span class="ruby-identifier">name</span>]
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">TYPES_ID</span>[<span class="ruby-identifier">name</span>], <span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-name">
            
              <b>name</b>(id)
            
            <a href="../classes/StaffRecordType.html#method-c-name" name="method-c-name" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-name_source')" id="l_method-c-name_source">show</a>
                
              </p>
              <div id="method-c-name_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/enums/staff_record_type.rb, line 37</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">name</span>(<span class="ruby-identifier">id</span>)
  <span class="ruby-constant">ID_TYPES</span>[<span class="ruby-identifier">id</span>]
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-name_in">
            
              <b>name_in</b>(names)
            
            <a href="../classes/StaffRecordType.html#method-c-name_in" name="method-c-name_in" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-name_in_source')" id="l_method-c-name_in_source">show</a>
                
              </p>
              <div id="method-c-name_in_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/enums/staff_record_type.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">name_in</span>(<span class="ruby-identifier">names</span>)
  <span class="ruby-constant">ID_TYPES</span>.<span class="ruby-identifier">find_all</span>(<span class="ruby-operator">&amp;</span><span class="ruby-operator">-</span><span class="ruby-operator">&gt;</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span>){<span class="ruby-identifier">names</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">val</span>)}).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-operator">-</span><span class="ruby-operator">&gt;</span>(<span class="ruby-identifier">tipe</span>){<span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">tipe</span>) })
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(_id, _name)
            
            <a href="../classes/StaffRecordType.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/enums/staff_record_type.rb, line 8</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">_id</span>, <span class="ruby-identifier">_name</span>)
  <span class="ruby-ivar">@id</span>=<span class="ruby-identifier">_id</span>
  <span class="ruby-ivar">@name</span>=<span class="ruby-identifier">_name</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                        </div>

    </div>
  </body>
</html>
